﻿@model Telerik.Web.Mvc.GridModel<ProductTagModel>

@{
    var gridPageSize = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().GridPageSize;
}
@using Telerik.Web.Mvc.UI;
@using System.Linq;
<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/Administration/Content/images/ico-catalog.png")" alt="" />
        @T("Admin.Catalog.ProductTags")
    </div>
</div>
<table class="adminContent">
    <tr>
        <td>
            @(Html.Telerik().Grid(Model.Data)
                    .Name("product-tags-grid")
                    .DataKeys(x =>
                    {
                        x.Add(y => y.Id).RouteKey("Id");
                    })
                    .Columns(columns =>
                    {
                        columns.Bound(x => x.Name);
                        columns.Bound(x => x.ProductCount).Width(150);
                        columns.Command(commands =>
                        {
                            commands.Delete();
                        }).Width(90)
                        .Title(T("Admin.Common.Delete").Text);

                    })
                    .Filterable()
                    .Pageable(settings => settings.PageSize(gridPageSize).Total(Model.Total).Position(GridPagerPosition.Both))
                    .DataBinding(dataBinding =>
                    {
                        dataBinding.Ajax().Select("ProductTags", "Product")
                            .Delete("ProductTagDelete", "Product");
                    })
                    .EnableCustomBinding(true))
        </td>
    </tr>
</table>
